<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        window.onload=function () {
            var bt=document.getElementById("bt");
            var username=document.getElementsByName("username")[0];
            var password=document.getElementsByName("password")[0];
            var xhr=new XMLHttpRequest();
            var url="http://localhost:8080/web_war_exploded/second"
            xhr.onreadystatechange=function () {
                if (xhr.status==200&&xhr.readyState==4){
                    console.log(xhr.responseText);
                }

            }
            bt.onclick=function () {
                xhr.open("GET",url+"?"+"username"+username.value+"&password="+password.value);
                xhr.send();
            }
        }
    </script>
</head>
<body>
<form>
    账户:<input type="text" name="username"><br>
    <hr>
    密码:<input type="password" name="password">
    <br>
    <button id="bt">测试</button>
</form>
</body>
</html>